<?php echo $header; ?><?php echo $column_left; ?>
    <div id="content">
        <div class="page-header">
            <div class="container-fluid">
                <div class="pull-right">

                    <a style="display: none;" href="<?php echo $cancel; ?>" data-toggle="tooltip" title="<?php echo $button_cancel; ?>" class="btn btn-default"><i class="fa fa-reply"></i></a></div>
                <h1><?php echo $heading_title; ?></h1>

            </div>
        </div>
        <div class="container-fluid">
            <?php if ($error_warning) { ?>
                <div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> <?php echo $error_warning; ?>
                    <button type="button" class="close" data-dismiss="alert">&times;</button>
                </div>
            <?php } ?>
            <div class="panel panel-default">

                <div class="panel-body">
                    <div class="tab-content">
                        <div class="tab-pane active" id="tab-general">
                        	<div class="preview_box">
                        		<div class="preview_title" id="preview_title" ><?php echo $extra['post_title']; ?></div>
                                <div class="authorinfo">
                                    <p id="preview_date"><?php echo isset($extra['post_modified']) ? $extra['post_modified'] : $extra['post_date']; ?></p>
                                </div>
                                <div class="ac_details" id="preview_content">
                                    <?php echo $extra['post_content']; ?>
                                </div>
                        	</div>
                            <!--<div class="ac_details" id="comments">
                                <?php echo $extra['post_comments']; ?>
                            </div>-->
                        </div>
                    </div>
                </div>
            </div>
            <div class="ac_details" id="comments">
            	<h4>私信留言：</h4>
                <?php echo $extra['post_comments']; ?>
            </div>
        </div>
    </div>

    <div class="ui_pop" id="add_comment" style="display: none;">
        <input type="hidden" id="input_post_id" />
        <input type="hidden" id="input_customer_id" />
        <div class="article_content">
            <div class="ac_item">
                <a class="ac_close" onclick="$('#add_comment').hide();"><i class="fa fa-times" aria-hidden="true"></i></a>
                <div class="ac_editor">
                    <textarea class="ac_details"  placeholder="写评论" style="height: 180px;width:600px;" id="txt_comment" ></textarea>
                </div>
                <a class="comment_btn"  onclick="send_comment()">提交</a>
            </div>
        </div>


    </div>

<script type="text/javascript">

    function send_comment() {
        $.ajax({
            url: 'index.php?route=article/article/comment&token=<?php echo $token; ?>&ID=' +  encodeURIComponent( $("#input_post_id").val()) + "&customer_id=" + encodeURIComponent($("#input_customer_id").val()) + "&message=" + encodeURIComponent($("#txt_comment").val()),
            dataType: 'json',
            success: function(json) {
                window.location.reload();
            },
            error: function(XMLHttpRequest, textStatus, errorThrown){
                window.location.reload();
            }
        });



    }

    function comment(post_id, customer_id) {
        $("#input_post_id").val(post_id);
        $("#input_customer_id").val(customer_id);
        $("#txt_comment").val('');
        $('#add_comment').show();
    }
</script>
<?php echo $footer; ?>